﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace NGPT.ApproveIt.Tests
{
    [TestClass]
    public class ApproveItPresenterTests
    {
        [TestMethod]
        public void SubmitRequest_PopulatesViewWithResult()
        {
            // Arrange
            var view = new MockApproveItView();
            view.ApproverLoginName = @"DOMAIN\user";
            var model = new MockApprovalService();
            var presenter = new ApproveItPresenter(view, model);

            // Act
            presenter.RequestApproval();

            // Assert
            Assert.AreEqual<string>(string.Format("Your request has been sent to user {0} successfully.", @"DOMAIN\user"), view.ResultMessage);
        }
    }
}
